$(function () {
    var wstb = document.getElementById("wstb");
    var wstbEcharts = echarts.init(wstb);
    wstbEcharts.setOption(wstboption, true);

    var dataImport = document.getElementById("dataImport");
    var dataImportEchart = echarts.init(dataImport);
    dataImportEchart.setOption(dataImportoption, true);

    var dataRelation = document.getElementById("dataRelation");
    var dataRelationEchart = echarts.init(dataRelation);
    dataRelationEchart.setOption(dataRelationoption, true);

    var khdsb = document.getElementById("khdsb");
    var khdsbEchart = echarts.init(khdsb);
    khdsbEchart.setOption(kwdsbOption, true);

    var fwsq = document.getElementById("fwsq");
    var fwsqEchart = echarts.init(fwsq);
    fwsqEchart.setOption(fwsqOption, true);

    var CPU1 = document.getElementById("CPU1");
    var CPU1Echart = echarts.init(CPU1);
    CPU1Echart.setOption(CPU1option, true);

    var CPU2 = document.getElementById("CPU2");
    var CPU2Echart = echarts.init(CPU2);
    CPU2Echart.setOption(CPU2option, true);

    var sjdata = document.getElementById("sjdata");
    var sjdataEchart = echarts.init(sjdata);
    sjdataEchart.setOption(wstboption, true);
    sjdataEchart.setOption({
        legend: {
            data: ['发送量', '接收量'],
        },
        series: [
            {
                name: '发送量'
            }, {
                name: '接收量'
            }
        ]
    });

    var jrnc = document.getElementById("jrnc");
    var jrncEchart = echarts.init(jrnc);
    jrncEchart.setOption(gaugeOption, true);
    jrncEchart.setOption(jrzy);

    var jrrkl = document.getElementById("jrrkl");
    var jrrklEchart = echarts.init(jrrkl);
    jrrklEchart.setOption(gaugeOption, true);
    jrrklEchart.setOption(zz);

    var zrkl = document.getElementById("zrkl");
    var zrklEchart = echarts.init(zrkl);
    zrklEchart.setOption(gaugeOption, true);
    zrklEchart.setOption(rk);

    var zzync = document.getElementById("zzync");
    var zzyncEchart = echarts.init(zzync);
    zzyncEchart.setOption(gaugeOption, true);
    zzyncEchart.setOption(zr);

    var wlfw = document.getElementById("wlfw");
    var wlfwEchart = echarts.init(wlfw);
    wlfwEchart.setOption(wlfwOption, true);

    var yyrj = document.getElementById("yyrj");
    var yyrjEchart = echarts.init(yyrj);
    yyrjEchart.setOption(yyrjoption, true);

    var lwsb = document.getElementById("lwsb");
    var lwsbEchart = echarts.init(lwsb);
    lwsbEchart.setOption(lwsboption, true);

    var czxt = document.getElementById("czxt");
    var czxtEchart = echarts.init(czxt);
    czxtEchart.setOption(czxtoption, true);

    $(window).resize(function () {
        wstbEcharts.resize();
        dataImportEchart.resize();
        dataRelationEchart.resize();
        khdsbEchart.resize();
        fwsqEchart.resize();
    });

    setInterval(function () {
        //网上填报
        var dt1 = [];
        var dt2 = [];
        for (var i = 0; i < wstbdata1.length; i++) {
            dt1.push(wstbdata1[i] + parseInt(Math.random() * 50));
            dt2.push(wstbdata2[i] + parseInt(Math.random() * 50));
        }
        // console.log(dt1);
        wstbEcharts.setOption({
            series: [{
                data: dt1
            }, {
                data: dt2
            }]
        });
        sjdataEchart.setOption({
            legend: {
                data: ['发送量', '接收量'],
            },
            series: [
                {
                    data: dt1,
                    name: '发送量'
                }, {
                    data: dt2,
                    name: '接收量'
                }
            ]
        });
        wstbdata1 = dt1;
        wstbdata2 = dt2;


        //数据导入
        var Imp1 = [];
        var Imp2 = [];
        for (var i = 0; i < Impor1.length; i++) {
            Imp1.push(Impor1[i] + parseInt(100-(Math.random()*200)));
            Imp2.push(Impor2[i] + parseInt(100-(Math.random()*200)));
        }
        dataImportEchart.setOption({
            series: [{
                data: Imp1
            }, {
                data: Imp2
            }]
        });
        Impor1=Imp1;
        Impor2=Imp2;

        //客户端设备状态监控
        var khdData = kwdsbOption.series[0].data;
        $.each(khdData,function (i,e) {
            khdData[i].value = e.value + parseInt(20-(Math.random()*40))
        });
        khdsbEchart.setOption({
            series: [{
                data: khdData
            }]
        });

        // 服务申请资源趋势
        var fwsqData = fwsqOption.series[0].data;
        for (var i = 0; i < fwsqData.length; i++) {
            fwsqData[i] = fwsqData[i] + parseInt(100-(Math.random()*200));
        }
        fwsqEchart.setOption({
            series: [{
                data: fwsqData
            }]
        });

        //CPU1
        var CPU1Data = CPU1option.series[0].data;
        CPU1Data[0].value = parseInt(Math.random()*40);
        CPU1Data[1].value = 100 - CPU1Data[0].value;
        CPU1Echart.setOption({
            series: [{
                data: CPU1Data
            }]
        });
        //CPU2
        var CPU2Data = CPU2option.series[0].data;
        CPU2Data[0].value = parseInt(Math.random()*40);
        CPU2Data[1].value = 100 - CPU2Data[0].value;
        CPU2Echart.setOption({
            series: [{
                data: CPU2Data
            }]
        });
        // 网络访问趋势
        for (var i=0;i<25;i++){
            wlfwdata[i] = (Math.random()*8).toFixed(2)
        }
        wlfwEchart.setOption({
            series: [{
                data: wlfwdata
            }]
        });

        // 联网设备
        var lwsbData = lwsboption.series[0].data;
        $.each(lwsbData,function (i,e) {
            lwsbData[i].value = e.value + parseInt(50-(Math.random()*100))
        });
        lwsbEchart.setOption({
            series: [{
                data: lwsbData
            }]
        });

        // 操作系统
        var czxtData = czxtoption.series[0].data;
        $.each(czxtData,function (i,e) {
            czxtData[i].value = e.value + parseInt(Math.random()*10)
        });
        czxtEchart.setOption({
            series: [{
                data: czxtData
            }]
        });

        var jrrklData = rk.series;
        jrrklData[0].axisLine.lineStyle.color[0][0] = Math.random().toFixed(2);
        jrrklData[0].data[0].value = (jrrklData[0].axisLine.lineStyle.color[0][0]*1).toFixed(2);
        var zrklData = zr.series;
        zrklData[0].axisLine.lineStyle.color[0][0] = Math.random().toFixed(2);
        zrklData[0].data[0].value = (zrklData[0].axisLine.lineStyle.color[0][0]*2.1).toFixed(2);
        jrrklEchart.setOption({
            series:jrrklData
        });
        zzyncEchart.setOption({
            series: zrklData
        });
    }, 5000);
});

// 网上填报
var wstbdata1 = [1320, 1332, 1301, 1334, 1390, 1301, 1334, 1390, 1301];
var wstbdata2 = [1220, 1182, 1191, 1234, 290, 1301, 1334, 1390, 290];
wstboption = {
    color: ['#003366', '#006699'],
    grid: {
        left: '1%',
        right: '9%',
        top: '15%',
        bottom: '0',
        containLabel: true
    },
    legend: {
        icon: 'circle',
        data: ['上午', '下午'],
        textStyle: {
            color: '#009eff'
        }
    },
    calculable: true,
    xAxis: [
        {
            type: 'category',
            data: ['综合法规', '科技创新', '行政服务', '商贸服务', '外资管理', '人事股', '持改产业', '经济运行', '办公室'],
            axisLabel: {
                color: '#009eff',
                rotate: 45
            },
            axisLine: {
                lineStyle: {
                    color: '#009eff'
                }
            },
        }
    ],
    yAxis: [
        {
            // splitNumber: 300,
            interval: 300,
            type: 'value',
            axisLabel: {
                color: '#009eff'
            },
            axisLine: {
                lineStyle: {
                    color: '#009eff'
                }
            },
            splitLine: {
                lineStyle: {
                    color: '#009eff'
                }
            }
        }
    ],
    series: [
        {
            name: '上午',
            type: 'bar',
            barGap: 0,
            barMaxWidth: 10,
            data: wstbdata1,
            itemStyle: {
                normal: {
                    barBorderRadius: [120, 120, 0, 0],
                    color: new echarts.graphic.LinearGradient(
                        0, 0, 0, 1,
                        [
                            {offset: 0, color: '#39b0cd'},
                            {offset: 1, color: '#1c59f6'}
                        ]
                    )
                },
            },
        },
        {
            name: '下午',
            type: 'bar',
            barMaxWidth: 10,
            data: wstbdata2,
            itemStyle: {
                normal: {
                    barBorderRadius: [120, 120, 0, 0],
                    color: new echarts.graphic.LinearGradient(
                        0, 0, 0, 1,
                        [
                            {offset: 0, color: '#c462ed'},
                            {offset: 1, color: '#9f10e5'}
                        ]
                    )
                },
            },
        }
    ]
};


//数据导入
var Impor1 = [0, 1500, 1900, 1300, 1700, 2100, 1160, 1000, 0];
var Impor2 = [0, 1020, 1130, 1000, 750, 1100, 740, 501, 0];
dataImportoption = {
    grid: {
        left: '1%',
        right: '9%',
        top: '20%',
        bottom: '5%',
        containLabel: true
    },
    tooltip: {
        show: true,
        trigger: 'item'
    },
    legend: {
        show: true,
        x: 'center',
        y: '5',
        // icon: 'circle',
        textStyle: {
            color: '#1bb4f6',
        },
        data: ['连表数据', '文件数据']
    },
    xAxis: [
        {
            type: 'category',
            // name : '日期',
            boundaryGap: false,
            // axisLabel:{
            // 	color: fontColor
            // },
            axisLine: {
                show: true,
                lineStyle: {
                    color: '#1bb4f6'
                }
            },
            // axisLabel:{
            //       interval:4,
            //},
            axisTick: {
                show: false,
            },
            data: ['10-01', '10-02', '10-03', '10-04', '10-05', '10-06', '10-07', '10-08', '10-09']
        }
    ],
    yAxis: [
        {
            axisTick: {
                show: true
            },
            type: 'value',
            min: 0,
            max: 2500,
            axisLabel: {
                formatter: '{value}',
                textStyle: {
                    color: '#1bb4f6'
                }
            },
            axisLine: {
                show: true,
                lineStyle: {
                    color: '#1bb4f6'
                }
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#1bb4f6'
                }
            }
        },
    ],
    series: [
        {
            name: '文件数据',
            type: 'line',
            // stack: '总量',
            symbol: 'circle',
            smooth: true,
            symbolSize: 8,
            itemStyle: {
                normal: {
                    color: '#0092f6',
                    lineStyle: {
                        color: "#0092f6",
                        width: 1
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
                            offset: 0,
                            color: 'rgba(7,44,90,0.3)'
                        }, {
                            offset: 1,
                            color: 'rgba(0,146,246,0.9)'
                        }]),
                    }
                }
            },
            markPoint: {
                itemStyle: {
                    normal: {
                        color: 'red'
                    }
                }
            },
            data: [0, 1500, 1900, 1300, 1700, 2100, 1160, 1000, 0]
        },
        {
            name: '连表数据',
            type: 'line',
            smooth: true,
            symbol: 'circle',
            symbolSize: 8,

            itemStyle: {
                normal: {
                    color: '#aecb56',
                    lineStyle: {
                        color: "#aecb56",
                        width: 1
                    },
                    areaStyle: {
                        //color: '#94C9EC'
                        color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
                            offset: 0,
                            color: 'rgba(7,44,90,0.3)'
                        }, {
                            offset: 1,
                            color: 'rgba(0,212,199,0.9)'
                        }]),
                    }
                }
            },
            data: [0, 1020, 1130, 1000, 750, 1100, 740, 501, 0]
        }
    ]
};

// 数据关联
dataRelationoption = {
    animationDuration: 3000,
    animationEasingUpdate: 'quinticInOut',
    series: [{
        name: '广州大学',
        type: 'graph',
        layout: 'force',
        force: {
            repulsion: 100
        },
        data: [
            {
                "name": "广州大学",
                "symbolSize": 20,
                "draggable": "true",
                "value": 27

            }, {
                "name": "计算机科学与教育软件学院",
                "value": 3,
                "symbolSize": 9,
                "category": "计算机科学与教育软件学院",
                "draggable": "true"
            }, {
                "name": "计算机科学与技术",
                "symbolSize": 13,
                "category": "计算机科学与教育软件学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "软件工程",
                "symbolSize": 23,
                "category": "计算机科学与教育软件学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "网络工程",
                "symbolSize": 33,
                "category": "计算机科学与教育软件学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "地理科学学院",
                "value": 16,
                "symbolSize": 18,
                "category": "地理科学学院",
                "draggable": "true"
            }, {
                "name": "地理科学",
                "symbolSize": 23,
                "category": "地理科学学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "地理信息科学",
                "symbolSize": 3,
                "category": "地理科学学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "人文地理与城乡规划",
                "symbolSize": 3,
                "category": "地理科学学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "人文地理与城乡规划(区域物流)",
                "symbolSize": 3,
                "category": "地理科学学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "人文地理与城乡规划(不动产)",
                "symbolSize": 3,
                "category": "地理科学学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "自然地理与资源环境",
                "symbolSize": 3,
                "category": "地理科学学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "机械与电气工程学院",
                "value": 5,
                "symbolSize": 15,
                "category": "机械与电气工程学院",
                "draggable": "true"
            }, {
                "name": "电气工程及其自动化",
                "symbolSize": 3,
                "category": "机械与电气工程学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "机械设计制造及其自动化",
                "symbolSize": 3,
                "category": "机械与电气工程学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "电子信息工程",
                "symbolSize": 3,
                "category": "机械与电气工程学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "工业设计",
                "symbolSize": 3,
                "category": "机械与电气工程学院",
                "draggable": "true",
                "value": 1
            }, {
                "name": "通信工程",
                "symbolSize": 3,
                "category": "机械与电气工程学院",
                "draggable": "true",
                "value": 1
            }],
        links: [
            {
                "source": "广州大学",
                "target": "计算机科学与教育软件学院"
            }, {
                "source": "计算机科学与教育软件学院",
                "target": "计算机科学与技术"
            }, {
                "source": "计算机科学与教育软件学院",
                "target": "软件工程"
            }, {
                "source": "计算机科学与教育软件学院",
                "target": "网络工程"
            }, {
                "source": "广州大学",
                "target": "地理科学学院"
            }, {
                "source": "地理科学学院",
                "target": "地理科学"
            }, {
                "source": "地理科学学院",
                "target": "地理信息科学"
            }, {
                "source": "地理科学学院",
                "target": "人文地理与城乡规划"
            }, {
                "source": "地理科学学院",
                "target": "人文地理与城乡规划(区域物流)"
            }, {
                "source": "地理科学学院",
                "target": "人文地理与城乡规划(不动产)"
            }, {
                "source": "地理科学学院",
                "target": "自然地理与资源环境"
            }, {
                "source": "广州大学",
                "target": "机械与电气工程学院"
            }, {
                "source": "机械与电气工程学院",
                "target": "电气工程及其自动化"
            }, {
                "source": "机械与电气工程学院",
                "target": "机械设计制造及其自动化"
            }, {
                "source": "机械与电气工程学院",
                "target": "电子信息工程"
            }, {
                "source": "机械与电气工程学院",
                "target": "工业设计"
            }, {
                "source": "机械与电气工程学院",
                "target": "通信工程"
            }],
        categories: [
            {
                'name': '计算机科学与教育软件学院'
            }, {
                'name': '地理科学学院'
            }, {
                'name': '机械与电气工程学院'
            }],
        focusNodeAdjacency: true,
        roam: true,
        label: {
            normal: {
                fontSize: 10,
                show: true,
                position: 'top',

            }
        },
        lineStyle: {
            normal: {
                color: 'source',
                curveness: 0.3,
                type: "solid"
            }
        },

    }]
};

//客户端设备状态监控
kwdsbOption = {
    color: ['#1699be', "#952ece", "#54eac3", '#fff650', '#febf39'],
    tooltip: {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    legend: {
        icon: 'circle',
        right: 10,
        bottom: 0,
        orient: 'vertical',
        textStyle: {
            color: '#009eff'
        }
    },
    series: [
        {
            type: 'pie',
            radius: '90%',
            center: ['40%', '50%'],
            data: [
                {value: 335, name: '开机率'},
                {value: 310, name: '使用率'},
                {value: 274, name: '升级率'},
                {value: 435, name: '故障率'},
                {value: 200, name: '重置率'}
            ].sort(function (a, b) {
                return a.value - b.value;
            }),
            roseType: 'radius',
            label: {
                normal: {
                    formatter: '{d}%'
                }
            },
            labelLine: {
                normal: {
                    smooth: 0.2,
                    length: 10,
                    length2: 20
                }
            }
        }
    ]
};

// 服务申请资源趋势
fwsqOption = {
    grid: {
        left: '1%',
        right: '9%',
        top: '20%',
        bottom: '5%',
        containLabel: true
    },
    tooltip: {
        show: true,
        trigger: 'item',
        formatter: '{a}<br> {b} : {c}条'
    },
    xAxis: [
        {
            type: 'category',
            // name : '日期',
            boundaryGap: false,
            // axisLabel:{
            // 	color: fontColor
            // },
            axisLine: {
                show: true,
                lineStyle: {
                    color: '#1bb4f6'
                }
            },
            // axisLabel:{
            //       interval:4,
            //},
            axisTick: {
                show: true,
            },
            data: ['10-01', '10-02', '10-03', '10-04', '10-05', '10-06', '10-07', '10-08', '10-09']
        }
    ],
    yAxis: [
        {
            name: '单位(条)',
            axisTick: {
                show: true
            },
            type: 'value',
            minInterval: 1,
            axisLabel: {
                formatter: '{value}',
                textStyle: {
                    color: '#1bb4f6'
                }
            },
            axisLine: {
                show: true,
                lineStyle: {
                    color: '#1bb4f6'
                }
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#1bb4f6'
                }
            }
        },
    ],
    series: [
        {
            name: '申请',
            type: 'line',
            smooth: true,
            symbolSize: 8,
            itemStyle: {
                normal: {
                    color: '#0092f6',
                    lineStyle: {
                        color: "#0092f6",
                        width: 1
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(64,110,231,0.9)'
                        }, {
                            offset: 1,
                            color: 'rgba(35,53,99,0.3)'
                        }]),
                    }
                }
            },
            markPoint: {
                itemStyle: {
                    normal: {
                        color: 'red'
                    }
                }
            },
            data: [0, 1500, 1900, 1300, 1700, 1100, 1160, 1000, 0]
        }
    ]
};

// cpu1
CPU1option = {
    series: [{
        type: 'pie',
        clockWise: false,
        radius: ['60%', '70%'],
        itemStyle: {
            normal: {
                label: {
                    show: false
                },
                labelLine: {
                    show: false
                },
                shadowBlur: 0,
                shadowColor: '#203665'
            }
        },
        hoverAnimation: false,
        center: ['50%', '50%'],
        data: [
            {
                value: 25,
                name: 'invisible',
                itemStyle: {
                    normal: {
                        color: 'rgba(64,110,231,0.2)'
                    }
                }
            }, {
                value: 81,
                label: {
                    normal: {
                        rich: {
                            a: {
                                color: '#b06237',
                                align: 'center',
                                fontSize: 24,
                                fontWeight: "bold"
                            }
                        },
                        formatter: function (params) {
                            return "{a|" + params.value + "%}";
                        },
                        position: 'center',
                        show: true,
                        textStyle: {
                            fontSize: '14',
                            fontWeight: 'normal',
                            color: '#fff'
                        }
                    }
                },
                itemStyle: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0,
                        color: '#feb53c'
                    }, {
                        offset: 1,
                        color: '#f27103'
                    }])
                }
            }]
    }]
};

// cpu2
CPU2option = {
    series: [{
        type: 'pie',
        clockWise: false,
        radius: ['60%', '70%'],
        itemStyle: {
            normal: {
                label: {
                    show: false
                },
                labelLine: {
                    show: false
                },
                shadowBlur: 0,
                shadowColor: '#203665'
            }
        },
        hoverAnimation: false,
        center: ['50%', '50%'],
        data: [
            {
                value: 25,
                name: 'invisible',
                itemStyle: {
                    normal: {
                        color: 'rgba(64,110,231,0.2)'
                    }
                }
            }, {
                value: 75,
                label: {
                    normal: {
                        rich: {
                            a: {
                                color: '#08d7ed',
                                align: 'center',
                                fontSize: 24,
                                fontWeight: "bold"
                            }
                        },
                        formatter: function (params) {
                            return "{a|" + params.value + "%}";
                        },
                        position: 'center',
                        show: true,
                        textStyle: {
                            fontSize: '14',
                            fontWeight: 'normal',
                            color: '#fff'
                        }
                    }
                },
                itemStyle: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0,
                        color: '#08d6ed'
                    }, {
                        offset: 1,
                        color: '#02b0ea'
                    }])
                }
            }]
    }]
};

// 今日占用内存
var jrzy = {
    title: {
        text: '今日占用内存'
    },
    series: [{
        axisLine: {
            lineStyle: {
                color: [
                    [
                        0.3, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                        offset: 0,
                        color: '#01d6bb'
                    },
                        {
                            offset: 1,
                            color: '#00f982'
                        }
                    ])
                    ],
                    [
                        1, '#00173e'
                    ]
                ]
            }
        },
        detail:{
            formatter: function (e) {
                return e + 'G'
            },
        },
        data: [{
            value: 0.48
        }]
    }]
};

//今日入库量
var rk = {
    title: {
        text: '今日入库量'
    },
    series: [{
        axisLine: {
            lineStyle: {
                color: [
                    [
                        0.5, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                        offset: 0,
                        color: '#0089ed'
                    },
                        {
                            offset: 1,
                            color: '#00b6f1'
                        }
                    ])
                    ],
                    [
                        1, '#00173e'
                    ]
                ]
            }
        },
        detail:{
            formatter: function (e) {
                return e + 'G'
            },
        },
        data: [{
            value: 1230
        }]
    }]
};

//总占用内存
var zz = {
    title: {
        text: '总占用内存'
    },
    series: [{
        axisLine: {
            lineStyle: {
                color: [
                    [
                        0.7, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                        offset: 0,
                        color: '#0b50ea'
                    },
                        {
                            offset: 1,
                            color: '#a920bd'
                        }
                    ])
                    ],[
                        1, '#00173e'
                    ]
                ]
            }
        },
        detail:{
            formatter: function (e) {
                return e + 'G'
            },
        },
        data: [{
            value: 0.74
        }]
    }]
};

//总入库量
var zr = {
    title: {
        text: '总入库量'
    },
    series: [{
        axisLine: {
            lineStyle: {
                color: [
                    [
                        0.43, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                        offset: 0,
                        color: '#fc8100'
                    },
                        {
                            offset: 1,
                            color: '#e59700'
                        }
                    ])
                    ],[
                        1, '#00173e'
                    ]
                ]
            }
        },
        detail:{
            formatter: function (e) {
                return e + '万'
            },
        },
        data: [{
            value: 2.34
        }]
    }]
};

gaugeOption = {
    title: [
        {
            text: '',
            left: '50%',
            top: '85%',
            textAlign: 'center',
            textStyle: {
                fontWeight: 'normal',
                fontSize: '16',
                color: '#009eff',
                textAlign: 'center',
            },
        }],
    series: [
        {
            type: 'gauge',
            radius: '100%',
            center: ['50%', '50%'],
            splitNumber: 0, //刻度数量
            startAngle: 225,
            endAngle: -45,
            axisLine: {
                show: true,
                lineStyle: {
                    width: 10,
                    shadowColor: '#0098df',
                    shadowBlur: 2,
                    color: [
                        [
                            0.9, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                            offset: 0,
                            color: '#5c53de'
                        },
                            {
                                offset: 1,
                                color: '#18c8ff'
                            }
                        ])],
                        [
                            1, '#00173e'
                        ]
                    ]
                }
            },
            //分隔线样式。
            splitLine: {
                show: false,
            },
            axisLabel: {
                show: false
            },
            axisTick: {
                show: false
            },
            pointer: {
                show: false
            },
            title: {
                show: true,
                offsetCenter: [0, '-26%'], // x, y，单位px
                textStyle: {
                    color: '#01c1c9',
                    fontSize: 20
                }
            },
            //仪表盘详情，用于显示数据。
            detail: {
                show: true,
                offsetCenter: [0, '16%'],
                color: '#01c1c9',
                formatter: function (e) {
                    return e + 'G'
                },
                textStyle: {
                    fontSize: 20
                }
            },
            data: [{
                value: 0
            }]
        }]
};

// 网络访问趋势
var wlfwdata = [];
for (var i=0;i<25;i++){
    wlfwdata[i] = (Math.random()*8).toFixed(2)
}
wlfwOption = {
    title: {
        text: '单位:万次',
        left: 'right',
        top:'10',
        textStyle:{
            color: '#01c1c9',
            fontSize: 12
        }
    },
    tooltip : {
        trigger: 'axis',
        formatter: '{c}万次'
    },
    grid: {
        left: '1%',
        right: '1%',
        top: '16%',
        bottom: '10',
        containLabel: true
    },
    calculable: true,
    xAxis: [
        {
            type: 'category',
            data: wlfwdata,
            axisLabel: {
                show:false,
                color: '#009eff'
            },
            axisLine: {
                lineStyle: {
                    width: 2,
                    color: '#015dd7'
                }
            },
            axisTick:{
                show:false
            }
        }
    ],
    yAxis: [
        {
            // splitNumber: 300,
            interval: 1.5,
            type: 'value',
            axisLabel: {
                color: '#01c0c8'
            },
            axisLine: {
                show:false,
                lineStyle: {
                    color: '#009eff'
                }
            },
            axisTick:{
                show:false
            },
            splitLine: {
                show:false,
                lineStyle: {
                    color: '#009eff'
                }
            }
        }
    ],
    series: [
        {
            type: 'bar',
            barGap: 0,
            barMaxWidth: 10,
            data: wlfwdata,
            itemStyle: {
                normal: {
                    barBorderRadius: [120, 120, 0, 0],
                    color: new echarts.graphic.LinearGradient(
                        0, 0, 0, 1,
                        [
                            {offset: 0, color: '#00b9ef'},
                            {offset: 1, color: '#015dd7'}
                        ]
                    )
                },
            },
        }
    ]
};

// 应用软件
yyrjoption = {
    color:['#38accf','#a054cc'],
    tooltip: {},
    legend: {
        data: ['预分配', '实际开销'],
        icon: 'circle',
        textStyle: {
            color: '#009eff'
        },
        left:'right'
    },
    radar: {
        // shape: 'circle',
        name: {
            textStyle: {
                color: '#009eff'
            }
        },
        startAngle: 0,
        axisLine: {
            lineStyle: {
                width: 1,
                color: '#009eff'
            }
        },
        splitLine: {
            lineStyle: {
                color: '#009eff',
                width: 2
            }
        },
        splitArea: {
            areaStyle: {
                color: 'rgba(96, 105, 141, .6)'
            }
        },


        indicator: [{
            name: '媒体编辑器',
            max: 100
        },
            {
                name: '图像处理',
                max: 100
            },
            {
                name: '办公软件',
                max: 100
            },
            {
                name: '媒体格式转化器',
                max: 100
            },
            {
                name: '媒体播放器',
                max: 100
            },
            {
                name: '通信软件',
                max: 100
            }
        ]

    },
    series: [{
        type: 'radar',
        lineStyle: {
            color: 'rgba(255,43,43,0)'
        },
        areaStyle: {
            color: 'rgba(42,119,155,0.9)'
        },
        data: [
            {
                value: [20, 40, 50, 71, 30, 85],
                name: '预分配'
            }
        ]
    },{
        type: 'radar',
        lineStyle: {
            color: 'rgba(255,43,43,0)'
        },
        areaStyle: {
            color: 'rgba(160,84,204,0.9)'
        },
        data: [
            {
                value: [60, 40, 30, 20, 54, 60],
                name: '实际开销'
            }
        ]
    }
    ]
};


// 联网设备
lwsboption = {
    color:['#2782fa','#4ee64f','#f22ca7','#d2ed27','#1dc9d7'],
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    series: [
        {
            name:'联网设备',
            type:'pie',
            radius: ['60%', '80%'],
            // avoidLabelOverlap: false,
            hoverAnimation: true,
            // roseType: 'radius',
            label: {
                textStyle:{
                    color: '#009eff'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold',
                    }
                }
            },
            labelLine: {
                smooth: 0.1,        //此处是改变折线的长度
                length: 10,
                length2: 4,
                lineStyle:{
                    color:'#009eff'
                }
            },
            data:[
                {value:335, name:'其他设备'},
                {value:310, name:'边界设备'},
                {value:234, name:'网络设备'},
                {value:135, name:'服务器设备'},
                {value:1548, name:'终端设备'}
            ]
        }
    ]
};

// 操作系统
czxtoption = {
    color:['#0182d9','#fb059e','#9a25fe','#17ef00','#00bf11','#fff600','#2c49f8','#f3782d','#8cdd0b','#1dc9d7'],
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    series: [
        {
            name:'操作系统',
            type:'pie',
            radius: ['20%', '60%'],
            // avoidLabelOverlap: false,
            hoverAnimation: true,
            roseType: 'radius',
            label: {
                textStyle:{
                    color: '#009eff'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold',
                    }
                }
            },
            labelLine: {
                smooth: 0.1,        //此处是改变折线的长度
                length: 10,
                length2: 4,
                lineStyle:{
                    color:'#009eff'
                }
            },
            data:[
                {value:23, name:'Windows 7'},
                {value:31, name:'Windows xp'},
                {value:34, name:'Windows 8.1'},
                {value:35, name:'Windows server 2003'},
                {value:18, name:'Windows server 2008'},
                {value:35, name:'Windows others'},
                {value:10, name:'Windows 8'},
                {value:24, name:'Windows vista'},
                {value:35, name:'Windows linux'},
                {value:14, name:'Windows 2000'}
            ]
        }
    ]
};
